Skip to content

fix(ext/node): remove extra properties from node:fs exports#32670

Merged
bartlomieju merged 2 commits intomainfrom
fix/fs-remove-extra-exports
Mar 13, 2026
Merged

fix(ext/node): remove extra properties from node:fs exports#32670
bartlomieju merged 2 commits intomainfrom
fix/fs-remove-extra-exports

Conversation

@bartlomieju
Copy link
Member

Summary

  • Remove 18 flag constants (F_OK, R_OK, W_OK, X_OK, O_RDONLY,
    O_WRONLY, etc.) from node:fs default and named exports — Node.js only
    exposes these via fs.constants, not as top-level properties
  • Remove internal promise helpers (watchPromise, readFilePromise,
    readlinkPromise) from the default export object
  • Remove statPromise, realpathPromise, statfsPromise from named exports
    (already defined locally in promises.ts)

After this change, Object.keys(require("node:fs")) in Deno matches Node.js
except for 4 not-yet-implemented features (FileReadStream, FileWriteStream,
Utf8Stream, mkdtempDisposableSync).

Test plan

  • cargo build --bin deno passes
  • deno lint ext/node/polyfills/fs.ts passes
  • Verified with ESM and CJS comparison scripts against Node.js
  • CI green

🤖 Generated with Claude Code

bartlomieju and others added 2 commits March 12, 2026 18:28
Remove properties from node:fs default and named exports that Node.js
does not export:
- 18 flag constants (F_OK, R_OK, W_OK, X_OK, O_*) that should only
  be available via fs.constants
- watchPromise, readFilePromise, readlinkPromise internal helpers
- statPromise, realpathPromise, statfsPromise (duplicated in promises.ts)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bartlomieju bartlomieju requested a review from Tango992 March 12, 2026 17:55
Copy link
Member

@Tango992 Tango992 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bartlomieju bartlomieju merged commit 92ca1fe into main Mar 13, 2026
112 checks passed
@bartlomieju bartlomieju deleted the fix/fs-remove-extra-exports branch March 13, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants